<template>
  <div class="app-container">
    <el-row :gutter="20">
      <!--部门数据-->
      <el-col :span="4" :xs="24">
        <div class="head-container">
          <el-tree :data="deptOptions" :expand-on-click-node="false" :filter-node-method="filterNode" ref="tree"
            :label="clusteName" default-expand-all @node-click="handleNodeClick" />
        </div>
      </el-col>
      <el-col :span="20" :xs="24">
        <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
          <el-form-item label="标题" prop="title">
            <el-input v-model="queryParams.title" placeholder="请输入标题" clearable size="small"
              @keyup.enter.native="handleQuery" />
          </el-form-item>
          <el-form-item>
            <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
            <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
          </el-form-item>
        </el-form>

        <el-row :gutter="10" class="mb8">
          <el-col :span="1.5">
            <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
              v-hasPermi="['receipt:exampleSubjectManager:add']">新增</el-button>
          </el-col>
          <el-col :span="1.5">
            <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
              v-hasPermi="['receipt:exampleSubjectManager:edit']">修改</el-button>
          </el-col>
          <el-col :span="1.5">
            <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
              v-hasPermi="['receipt:exampleSubjectManager:remove']">删除</el-button>
          </el-col>
          <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
        </el-row>
        <el-table v-loading="loading" :data="managerList" @selection-change="handleSelectionChange">
          <el-table-column type="selection" width="55" align="center" />
          <el-table-column label="id" align="center" prop="id" v-if="false" />
          <el-table-column label="标题" align="center" prop="title" />
          <el-table-column label="类型" align="center" prop="type" :formatter="topictypeFormat" />
          <el-table-column label="难度" align="center" prop="diffictRatio" />-->
          <el-table-column label="重要性" align="center" prop="importRatio" v-if="false" />
          <el-table-column label="基础分值" align="center" prop="baseRatio" v-if="false" />
          <el-table-column label="例题得分" align="center" prop="knowledgeScore" v-if="false" />
          <el-table-column label="审核状态" align="center" prop="status" :formatter="statusFormat" />
          <el-table-column label="备注" align="center" prop="remark" v-if="false" />
          <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
            <template slot-scope="scope">
              <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" id="buttonedit"
                v-hasPermi="['receipt:exampleSubjectManager:edit']">修改</el-button>
              <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
                v-hasPermi="['receipt:exampleSubjectManager:remove']">删除</el-button>
            </template>
          </el-table-column>
        </el-table>
        <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
          @pagination="getList" />
      </el-col>
    </el-row>
    <!-- 知识点列表表单 -->
    <el-dialog :title="title1" :visible.sync="ZSVisible" width="500px" append-to-body>
      <div>
        <el-input v-model="name" placeholder="请输入标题" clearable size="small" style="width:55%"></el-input>
        <el-button @click="zs()" style="margin-left: 15px;">搜索</el-button>
      </div>
      <el-table :data="ZSAuditList" @selection-change="handleSelectionChange2" @select="selectChange2"
        ref="multipleTable" @row-click="handleRowClick2" @select-all="selectAll2" style="margin-top: 15px;">
        <el-table-column type="selection" width="55" align="center" />
        <el-table-column label="id" align="center" prop="id" v-if="false" />
        <el-table-column label="知识点" align="center" prop="title" />
      </el-table>
      <pagination v-show="total>0" :total="total1" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
        @pagination="ClusteZ" />
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitFormZ()">确 定</el-button>
        <el-button @click="cancelZ">取 消</el-button>
      </div>
    </el-dialog>
    <!-- 添加或修改例题题目管理对话框 -->
    <el-dialog :title="titleName" :visible.sync="open" width="500px"    append-to-body >
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="标题" prop="title">
          <el-input v-model="form.title" placeholder="请输入标题" />
        </el-form-item>
        <el-form-item label="类型" prop="topictype">
          <el-select v-model="form.type" placeholder="请选择类型">
            <el-option v-for="dict in topictypeOptions" :key="dict.dictValue" :label="dict.dictLabel"
              :value="parseInt(dict.dictValue)"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="知识类型" prop="knowledgeManagerId">
          <el-button @click="ClusteZ">选择知识点</el-button>
          <el-input v-model="this.knowledgeId" :disabled="true" v-if="false"></el-input>
          <el-input v-model="this.knowledgeManager" :disabled="true" style="width: 30%; margin-left: 15px"></el-input>
        </el-form-item>
        <el-form-item label="难度" prop="diffictRatio">
          <el-input-number v-model="form.diffictRatio" placeholder="请输入难度" controls-position="right" />
        </el-form-item>
        <el-form-item label="重要性" prop="importRatio">
          <el-input-number v-model="form.importRatio" placeholder="请输入重要性" controls-position="right" />
        </el-form-item>
        <el-form-item label="基础分值" prop="baseRatio">
          <el-input-number v-model="form.baseRatio" placeholder="请输入基础分值" controls-position="right" />
        </el-form-item>
        <!-- 题目答案选项列表 -->
        <el-form-item label="选项A" prop="baseRatioA">
          <el-checkbox type="checkbox" v-model="checkboxA" style="margin-right: 15px" />
          <el-input v-model="baseRatioA" placeholder="请输入选择A答案" style="width: 55%" id="baseRatioA" />
        </el-form-item>
        <el-form-item label="选项B" prop="baseRatioB">
          <el-checkbox type="checkbox" v-model="checkboxB" style="margin-right: 15px" />
          <el-input v-model="baseRatioB" id="baseRatioB" placeholder="请输入选择B答案" style="width: 55%" />
        </el-form-item>
        <el-form-item label="选项C" prop="baseRatioC">
          <el-checkbox type="checkbox" v-model="checkboxC" style="margin-right: 15px" />
          <el-input v-model="baseRatioC" id="baseRatioC" placeholder="请输入选择C答案" style="width:55%" />
        </el-form-item>
        <el-form-item label="选项D" prop="baseRatioD">
          <el-checkbox type="checkbox" v-model="checkboxD" style="margin-right: 15px" />
          <el-input v-model="baseRatioD" id="baseRatioD" placeholder="请输入选择D答案" style="width:55%" />
        </el-form-item>
        <el-form-item label="选项E" prop="baseRatioE">
          <el-checkbox type="checkbox" v-model="checkboxE" style="margin-right: 15px" />
          <el-input v-model="baseRatioE" id="baseRatioE" placeholder="请输入选择E答案" style="width:55%" />
        </el-form-item>
        <el-form-item label="选项F" prop="baseRatioF">
          <el-checkbox type="checkbox" v-model="checkboxF" style="margin-right: 15px" />
          <el-input v-model="baseRatioF" id="baseRatioF" placeholder="请输入选择F答案" style="width:55%" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<script>
  import {
    listManagerL,
    getManager,
    delManager,
    addManager,
    updateManager,
    exportManager
  } from "@/api/receipt/exampleSubjectManage";
  import {
    listCluste,
    getTreeData
  } from "@/api/receipt/subjectcluste";
  import {
    listManager,
    selectKmName,
    selectKnowledge
  } from "@/api/knowledge/knowledgeManager";
  export default {
    name: "Manager",
    components: {},
    data() {
      var checkAge = (rule, knowledgeManagerId, callback) => {
        if (this.knowledgeId == "") {
          return callback(new Error('请选择知识点'));
        } else {
          callback();
        }
      };
      var diffictRatio = (rule, value, callback) => {
        if (value > 100) {
          return callback(new Error('难度不能大于100'));
        } else if (value <= 0) {
          return callback(new Error('难度不能小于1'));
        } else if (Number(value) + '' == 'NaN') {
          return callback(new Error('难度个数必须为数字'));
        } else {
          callback();
        }
      };
      var importRatio = (rule, value, callback) => {
        if (value > 100) {
          return callback(new Error('重要性不能大于100'));
        } else if (value <= 0) {
          return callback(new Error('重要性不能小于1'));
        } else if (Number(value) + '' == 'NaN') {
          return callback(new Error('重要性必须为数字'));
        } else {
          callback();
        }
      };
      var baseRatio = (rule, value, callback) => {
        if (value > 1000) {
          return callback(new Error('基础分值不能大于1000'));
        } else if (value <= 0) {
          return callback(new Error('基础分值不能小于1'));
        } else if (Number(value) + '' == 'NaN') {
          return callback(new Error('基础分值个数必须为数字'));
        } else {
          callback();
        }
      };
      var baseRatioA = (rule, value, callback) => {
        if (this.checkboxA == true && this.baseRatioA == "") {
          return callback(new Error('勾选必须要填写正确答案'));
        } else {
          callback();
        }
      };
      var baseRatioB = (rule, value, callback) => {
        if (this.checkboxB == true && this.baseRatioB == "") {
          return callback(new Error('勾选必须要填写正确答案'));
        } else {
          callback();
        }
      };
      var baseRatioC = (rule, value, callback) => {
        if (this.baseRatioC == true && this.baseRatioC == "") {
          return callback(new Error('勾选必须要填写正确答案'));
        } else {
          callback();
        }
      };
      var baseRatioD = (rule, value, callback) => {
        if (this.baseRatioD == true && this.baseRatioD == "") {
          return callback(new Error('勾选必须要填写正确答案'));
        } else {
          callback();
        }
      };
      var baseRatioE = (rule, value, callback) => {
        if (this.baseRatioE == true && this.baseRatioE == "") {
          return callback(new Error('勾选必须要填写正确答案'));
        } else {
          callback();
        }
      };
      var baseRatioF = (rule, value, callback) => {
        if (this.baseRatioF == true && this.baseRatioF == "") {
          return callback(new Error('勾选必须要填写正确答案'));
        } else {
          callback();
        }
      };
      return {
        subjectClusteId: null,
        title1: "知识点选择",
        filterNode: null,
        deptOptions: [],
        ZSAuditList: [],
        name: null,
        checkboxA: false,
        checkboxB: false,
        checkboxC: false,
        checkboxD: false,
        checkboxE: false,
        checkboxF: false,
        knowledgeManagerId: null,
        baseRatioA: "",
        baseRatioB: "",
        baseRatioC: "",
        baseRatioD: "",
        baseRatioE: "",
        baseRatioF: "",
        option: [],
        correctoption: [],
        handleSelectionList: [],
        clusteAuditList: [],
        knowledgeManager: "",
        dialogVisible: [],
        ZSVisible: false,
        // 遮罩层
        loading: true,
        // 选中数组
        ids: [],
        idscluste: "",
        clusteName: [],
        knowledgeId: "",
        // 非单个禁用
        single: true,
        // 非多个禁用
        multiple: true,
        // 显示搜索条件
        showSearch: true,
        // 总条数
        total: 0,
        total1: 0,
        // 例题题目管理表格数据
        managerList: [],
        // 弹出层标题
        titleName: "题目操作",
        // 是否显示弹出层
        open: false,
        // 类型 1选择题 2填空题字典
        topictypeOptions: [],
        // 审核状态 1未审核(默认) 2已审核字典
        statusOptions: [],
        // 查询参数
        queryParams: {
          pageNum: 1,
          pageSize: 10,
          title: null,
          type: null,
          subjectClusteId: null,
          knowledgeManagerId: null,
          diffictRatio: null,
          importRatio: null,
          baseRatio: null,
          knowledgeScore: null,
          status: null,
          isDel: null,
          id: null,
        },
        // 表单参数
        form: {},
        // 表单校验
        rules: {
          title: [{
            required: true,
            message: "请输入标题",
            trigger: "blur"
          }],
          type: [{
            required: true,
            message: "请输入类型",
            trigger: "blur"
          }],
          diffictRatio: [{
              required: true, //是否必填
              message: '难度不能为空', //规则
              trigger: 'blur' //何事件触发
            },
            {
              validator: diffictRatio,
              trigger: 'blur'
            },
          ],
          importRatio: [{
              required: true, //是否必填
              message: '重要性不能为空', //规则
              trigger: 'blur' //何事件触发
            },
            {
              validator: importRatio,
              trigger: 'blur'
            },
          ],
          baseRatio: [{
              required: true, //是否必填
              message: '基础分值不能为空', //规则
              trigger: 'blur' //何事件触发
            },
            {
              validator: baseRatio,
              trigger: 'blur'
            },
          ],
          knowledgeManagerId: [{
            required: true,
            validator: checkAge,
            trigger: 'blur'
          }],
          baseRatioA: [{
            required: true,
            validator: baseRatioA,
            trigger: 'blur'
          }],
          baseRatioB: [{
            required: true,
            validator: baseRatioB,
            trigger: 'blur'
          }],
          baseRatioC: [{
            required: true,
            validator: baseRatioC,
            trigger: 'blur'
          }],
          baseRatioD: [{
            required: true,
            validator: baseRatioD,
            trigger: 'blur'
          }],
          baseRatioE: [{
            required: true,
            validator: baseRatioE,
            trigger: 'blur'
          }],
          baseRatioF: [{
            required: true,
            validator: baseRatioF,
            trigger: 'blur'
          }],
        },
      };
    },
    created() {
      this.getList();
      this.getListCluste();
      this.getDicts("dict_topictype").then(response => {
        this.topictypeOptions = response.data;
      });
      this.getDicts("sys_audit_status").then(response => {
        this.statusOptions = response.data;
      });

    },
    methods: {
      /** 查询例题题目管理列表 */
      getList() {
        this.loading = true;
        listManagerL(this.queryParams).then(response => {
          this.managerList = response.rows;
          this.total = response.total;
          this.loading = false;
        });
      },
      /**
       * @param 查询题簇列表
       */
      getListCluste() {
        getTreeData(this.queryParams).then(response => {
          let studentData = eval(JSON.stringify(response));
          //alert(JSON.stringify(studentData))
          this.deptOptions = studentData;
        });
      },
      // 节点单击事件
      handleNodeClick(data) {
        this.queryParams.subjectClusteId = data.id;
        this.subjectClusteId = data.id;
        this.getList();
      },
      // 类型 1选择题 2填空题字典翻译
      topictypeFormat(row, column) {
        return this.selectDictLabel(this.topictypeOptions, row.type);
      },
      // 审核状态 1未审核(默认) 2已审核字典翻译
      statusFormat(row, column) {
        return this.selectDictLabel(this.statusOptions, row.status);
      },
      // 取消按钮
      cancel() {
        this.open = false;
        this.baseRatioA = "";
        this.baseRatioB = "";
        this.baseRatioC = "";
        this.baseRatioD = "";
        this.baseRatioE = "";
        this.baseRatioF = "";
        this.checkboxA = false;
        this.checkboxB = false;
        this.checkboxC = false;
        this.checkboxD = false;
        this.checkboxE = false;
        this.checkboxF = false;
        this.option = [];
        this.correctoption = [];
        this.knowledgeManager = "";
        this.knowledgeId = "";
        this.reset();
      },
      cancelT() {
        this.dialogVisible = false;
      },
      cancelZ() {
        this.ZSVisible = false;
      },
      // 表单重置
      reset() {
        this.form = {
          id: null,
          title: null,
          type: null,
          subjectClusteId: null,
          knowledgeManagerId: null,
          diffictRatio: 30,
          importRatio: 30,
          baseRatio: 30,
          knowledgeScore: null,
          status: null,
          isDel: null,
          createBy: null,
          createTime: null,
          updateBy: null,
          updateTime: null,
          remark: null,
          baseRatioA: "",
          baseRatioB: "",
          baseRatioC: "",
          baseRatioD: "",
          baseRatioE: "",
          baseRatioF: "",
        };
        this.resetForm("form");
      },
      /** 搜索按钮操作 */
      handleQuery() {
        this.queryParams.pageNum = 1;
        this.getList();
      },
      /** 重置按钮操作 */
      resetQuery() {
        this.resetForm("queryForm");
        this.handleQuery();
      },
      // 多选框选中数据
      handleSelectionChange(selection) {
        this.ids = selection.map(item => item.id)
        this.single = selection.length !== 1
        this.multiple = !selection.length
      },
      handleSelectionChange2(selection) {
        this.knowledgeId = selection[0].id
        this.knowledgeManager = selection[0].title
        //alert(JSON.stringify(selection.map(item => item.title)))
      },
      selectChange2(selection, row) {
        if (selection.length > 1) {
          const del_row = selection.shift()
          this.$refs.multipleTable.toggleRowSelection(del_row, false)
        }
      },
      // 点击行触发，选中或不选中复选框
      handleRowClick2(row, column, event) {
        this.$refs.multipleTable.toggleRowSelection(row)
        this.selectChange2(this.handleSelectionList)
      },
      selectAll2(selection) {
        if (selection.length > 1) {
          selection.length = 1
        }
      },
      /** 新增按钮操作 */
      handleAdd() {
        if (this.subjectClusteId == null) {
          this.$confirm('请先选择题簇再进行录入例题', "警告", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning"
          }).catch((err) => {
            console.log()
          });
        } else {
          this.reset();
          this.open = true;
          this.title = "添加例题题目管理";
        }
      },
      zs() {
        if (this.name.length == 0) {
          this.$confirm('请先输入搜索内容', "警告", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning"
          });
        } else {
          selectKmName(this.name).then(response => {
            this.ZSVisible = false;
            this.ZSAuditList = response;
            this.ZSVisible = true;
          });
        }
      },
      /** 修改按钮操作 */
      handleUpdate(row) {
        this.reset();
        const id = row.id || this.ids
        getManager(id).then(response => {
          this.form = response.data;

          //alert(JSON.stringify(response.data))
          this.option = response.data.option;
          this.correctoption = response.data.correctoption;
          if (this.option[0] != null) {
            this.baseRatioA = this.option[0];
          }
          if (this.option[1] != null) {
            this.baseRatioB = this.option[1];
          }
          if (this.option[2] != null) {
            this.baseRatioC = this.option[2];
          }
          if (this.option[3] != null) {
            this.baseRatioD = this.option[3];
          }
          if (this.option[4] != null) {
            this.baseRatioE = this.option[4];
          }
          if (this.option[5] != null) {
            this.baseRatioF = this.option[5];
          }
          this.clusteName = response.data.clusteName;
          this.knowledgeManager = response.data.zsName;
          this.knowledgeId=response.data.idsZS;
          // alert(this.correctoption[0]+"---"+this.baseRatioA)
          this.open = true;
          for (var i = 0; i <= this.correctoption.length; i++) {
            if (this.correctoption[i] == this.baseRatioA && this.correctoption[i] != null) {
              this.checkboxA = true;
            }
            if (this.correctoption[i] == this.baseRatioB && this.correctoption[i] != null) {
              this.checkboxB = true;
            }
            if (this.correctoption[i] == this.baseRatioC && this.correctoption[i] != null) {
              this.checkboxC = true;
            }
            if (this.correctoption[i] == this.baseRatioD && this.correctoption[i] != null) {
              this.checkboxE = true;
            }
            if (this.correctoption[i] == this.baseRatioE && this.correctoption[i] != null) {
              this.checkboxD = true;
            }
            if (this.correctoption[i] == this.baseRatioF && this.correctoption[i] != null) {
              this.checkboxF = true;
            }
          }
          this.title = "修改例题题目管理";
        });
      },
      ClusteZ() {
        selectKnowledge(this.queryParams).then(response => {
          this.total1 = response.total;
          this.ZSAuditList = response.rows;
          this.ZSVisible = true;
        });
      },
      /**
       * 题簇选择确定按钮
       */
      submitFormT() {
        this.dialogVisible = false;
      },
      submitFormZ() {

        this.ZSVisible = false;
      },
      /** 提交按钮 */
      submitForm() {
        this.$refs["form"].validate(valid => {
          if (valid) {
            if (this.form.id != null) {
              if (this.option.length > 0) {
                this.option = [];
                this.correctoption = [];

                if (this.baseRatioA.length > 0 && this.baseRatioA != null) {
                  this.option.push(this.baseRatioA)
                }
                if (this.baseRatioB.length > 0 && this.baseRatioB != null) {
                  this.option.push(this.baseRatioB)
                }
                if (this.baseRatioC.length > 0 && this.baseRatioC != null) {
                  this.option.push(this.baseRatioC)
                }
                if (this.baseRatioD.length > 0 && this.baseRatioD != null) {
                  this.option.push(this.baseRatioD)
                }
                if (this.baseRatioE.length > 0 && this.baseRatioE != null) {
                  this.option.push(this.baseRatioE)
                }
                if (this.baseRatioF.length > 0 && this.baseRatioF != null) {
                  this.option.push(this.baseRatioF)
                }
                if (this.checkboxA == true) {
                  this.correctoption.push(this.baseRatioA)
                }
                if (this.checkboxB == true) {
                  this.correctoption.push(this.baseRatioB)
                }
                if (this.checkboxC == true) {
                  this.correctoption.push(this.baseRatioC)
                }
                if (this.checkboxD == true) {
                  this.correctoption.push(this.baseRatioD)
                }
                if (this.checkboxE == true) {
                  this.correctoption.push(this.baseRatioE)
                }
                if (this.checkboxF == true) {
                  this.correctoption.push(this.baseRatioF)
                }
                this.form.option = this.option;
                this.form.correctoption = this.correctoption;
                this.form.subjectClusteId = this.idscluste;
                this.form.knowledgeManagerId = this.knowledgeId;
                updateManager(this.form).then(response => {
                  this.msgSuccess("修改成功");
                  this.open = false;
                  this.baseRatioA = "";
                  this.baseRatioB = "";
                  this.baseRatioC = "";
                  this.baseRatioD = "";
                  this.baseRatioE = "";
                  this.baseRatioF = "";
                  this.checkboxA = false;
                  this.checkboxB = false;
                  this.checkboxC = false;
                  this.checkboxD = false;
                  this.checkboxE = false;
                  this.checkboxF = false;
                  this.option = [];
                  this.correctoption = [];
                  this.knowledgeManager = "";
                  this.knowledgeId = "";
                  this.getList();
                });
              }
            } else {
              this.form.subjectClusteId = this.subjectClusteId;
              this.form.knowledgeManagerId = this.knowledgeId;
              if (this.baseRatioA.length > 0) {
                this.option.push(this.baseRatioA)
              }
              if (this.baseRatioB.length > 0) {
                this.option.push(this.baseRatioB)
              }
              if (this.baseRatioC.length > 0) {
                this.option.push(this.baseRatioC)
              }
              if (this.baseRatioD.length > 0) {
                this.option.push(this.baseRatioD)
              }
              if (this.baseRatioE.length > 0) {
                this.option.push(this.baseRatioE)
              }
              if (this.baseRatioF.length > 0) {
                this.option.push(this.baseRatioF)
              }
              if (this.checkboxA == true) {
                this.correctoption.push(this.baseRatioA)
              }
              if (this.checkboxB == true) {
                this.correctoption.push(this.baseRatioB)
              }
              if (this.checkboxC == true) {
                this.correctoption.push(this.baseRatioC)
              }
              if (this.checkboxD == true) {
                this.correctoption.push(this.baseRatioD)
              }
              if (this.checkboxE == true) {
                this.correctoption.push(this.baseRatioE)
              }
              if (this.checkboxF == true) {
                this.correctoption.push(this.baseRatioF)
              }
              this.form.option = this.option;
              this.form.correctoption = this.correctoption;
              this.form.subjectClusteId = this.subjectClusteId;
              this.form.knowledgeManagerId = this.knowledgeId;
              addManager(this.form).then(response => {
                this.msgSuccess("新增成功");
                this.baseRatioA = "";
                this.baseRatioB = "";
                this.baseRatioC = "";
                this.baseRatioD = "";
                this.baseRatioE = "";
                this.baseRatioF = "";
                this.checkboxA = false;
                this.checkboxB = false;
                this.checkboxC = false;
                this.checkboxD = false;
                this.checkboxE = false;
                this.checkboxF = false;
                this.open = false;
                this.option = [];
                this.correctoption = [];
                this.knowledgeManager = "";
                this.knowledgeId = "";
                this.getList();
              });
            }
          }
        });
      },
      /** 删除按钮操作 */
      handleDelete(row) {
        const ids = row.id || this.ids;
        this.$confirm('是否确认删除例题题目', "警告", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(function() {
          //alert(ids)
          return delManager(ids);
        }).then(() => {
          this.getList();
          this.msgSuccess("删除成功");
        })
      },
    }
  };
</script>
